Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | /** |
||
22 | inji.onLoad(function () { |
||
23 | setInterval(function () { |
||
24 | inji.Server.request({ |
||
25 | url: '/notifications/check', |
||
26 | success: function (result) { |
||
27 | for (var key in result) { |
||
|
|||
28 | inji.Notifications.showNotification(result[key].notification_name, result[key].notification_text); |
||
29 | } |
||
30 | } |
||
31 | }); |
||
32 | }, 30 * 1000); |
||
33 | }) |
When iterating over the keys of an object, this includes not only the keys of the object, but also keys contained in the prototype of that object. It is generally a best practice to check for these keys specifically: